<template>
  <el-drawer v-model="drawerVisible" :close-on-click-modal="false" :destroy-on-close="true" size="1000px" title="发票详情">
    <el-form label-position="top" require-asterisk-position="right" :inline="true" class="form-detail">
      <div class="p-title w-100 mb-12">开票信息</div>
      <div class="form-inline-wrap">
        <el-form-item label="申请时间">2024-06-10 09:29</el-form-item>
        <el-form-item label="开票状态">
          <el-tag type="primary">开票中</el-tag>
        </el-form-item>
        <el-form-item label="公司名称">中国冶金科工股份有限公司</el-form-item>
        <el-form-item label="开票金额(元)">
          <div class="text-primary">800.00</div>
        </el-form-item>
        <el-form-item label="税号">91110000710935716X</el-form-item>
        <el-form-item label="注册地址">天津市市辖区河西区陈塘庄街道966号104室</el-form-item>
        <el-form-item label="开户行">农业银行北京朝阳门支行</el-form-item>
        <el-form-item label="银行账户">000601531320386681</el-form-item>
      </div>
      <div class="p-title w-100 mb-12">合同信息</div>
      <div class="form-inline-wrap">
        <el-form-item label="合同编号">HT202404031200</el-form-item>
        <el-form-item label="合同金额(元)">8800.00</el-form-item>
        <el-form-item label="已收款金额(元)">6000.00</el-form-item>
        <el-form-item label="可开票金额(元)">3000.00</el-form-item>
        <el-form-item label="已开票金额(元)">
          <div class="text-sucess">2000.00</div>
        </el-form-item>
        <el-form-item label="未开票金额(元)">
          <div class="text-warning">1000.00</div>
        </el-form-item>
        <el-form-item label="开票中金额(元)">
          <div class="text-primary">800.00</div>
        </el-form-item>
      </div>
    </el-form>
    <template #footer>
      <el-button @click="close">取消</el-button>
      <el-button type="primary" @click="close">确定</el-button>
    </template>
  </el-drawer>
</template>

<script lang="ts" setup>
import { ref, defineEmits, defineExpose } from "vue";

const drawerVisible = ref(false);
const drawerProps = ref({});
// 接收父组件传过来的参数
const acceptParams = params => {
  drawerProps.value = params;
  drawerVisible.value = true;
};

const emit = defineEmits(["close"]);
const close = () => {
  drawerVisible.value = false;
  emit("close");
};

defineExpose({
  acceptParams
});
</script>
